<template>
  <page-detail @scrollToLower="scrollToLower">
    <view style="padding: 12px">
      <feedback-card
          v-for="(item) in dataSource"
          :key="item.indexCode"
          :row="item"
          :typeList="typeList"
      />
      <van-empty v-if="!dataSource.length" description="暂无数据"/>
    </view>
    <template #footer>
      <van-button round type="primary" @click="submit" style="width: 200px">意见征集</van-button>
    </template>
  </page-detail>
</template>

<script>
  import feedbackCard from "./components/feedbackCard.vue";
  import CourseCard from "../zhfw/components/CourseCard.vue";
  import {getDict} from "../../api/tbDict";
  import pagingMixin from "../../mixins/pagingMixin";
  export default {
  name: 'wx_pages_fzbz_disputeComplain',
    components:{CourseCard, feedbackCard},
    mixins:[pagingMixin],
    data(){
      return{
        feedbackList: [],
        typeList:[],
        restfulApi:'/tbSuggestion/page',
      }
    },
    onPullDownRefresh() {
      this.search()
    },
    methods:{
      submit(){
        this.$toPage('/pages/fzbz/disputeComplainSubmit')
      },
    },
    onShow(query) {
      this.search()
      getDict("suggestion_type").then(res=>{
        this.typeList = res.data.map(item => ({
          text: item.dictValue,
          value: item.dictKey
        }));
      })
    }
  }
</script>
